package com.javaxiaobang.controller;

import com.javaxiaobang.service.RibbonService;
import com.javaxiaobang.thread.ThreadLocalManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MainController {

    @Autowired
    private RibbonService ribbonService;

    /**
     * ribbon负载均衡
     */
    @GetMapping("")
    public Object index() {
        ThreadLocalManager.setCounter();
        return ribbonService.getDictList("线程"+ThreadLocalManager.getCounter());
    }


}
